<template>
  <div class="content">
    <div class="row">
      <div class="col-md-12">
        <div class="box">
          <!-- <div class="box-header">
            <h3 class="box-title">客户列表</h3>
          </div> -->
          <el-form :inline="true" :model="listQuery" class="demo-form-inline" label-width="75px">
            <el-form-item label="所属部门" prop="userCompany">
              <el-input v-model.trim="userCompany" disabled clearable style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="客户姓名" prop="custName">
              <el-input v-model.trim="listQuery.custName" placeholder="请输入客户姓名" clearable style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="证件号" prop="certID">
              <el-input v-model.trim="listQuery.certID" placeholder="请输入证件号" clearable style="width: 200px;"></el-input>
            </el-form-item>
            <el-form-item label="权益类型" prop="equityType">
              <el-select v-model="listQuery.equityType" placeholder="请选择权益类型" clearable @change="changeEquityType">
                <el-option v-for="item in gradeOptions" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
            </el-form-item>
            <el-form-item label="权益名称" prop="equityLevelID">
              <el-select v-model="listQuery.equityID" placeholder="请选择权益名称" clearable @change="changeEquity">
                <el-option v-for="item in equityOptions" :key="item.equityID" :label="item.equityName" :value="item.equityID" />
              </el-select>
            </el-form-item>
            <el-form-item label="权益级别" prop="equityLevelID">
              <el-select v-model="listQuery.equityLevelID" placeholder="请选择权益级别" clearable @change="changeEquityLevel">
                <el-option v-for="item in equityLevelOptions" :key="item.equityLevelID" :label="item.equityLevelName" :value="item.equityLevelID" />
              </el-select>
            </el-form-item>
            <el-form-item label="服务名称" prop="serviceName">
              <el-select v-model="listQuery.serviceID" placeholder="请选择服务名称" clearable>
                <el-option v-for="item in serviceNameList" :key="item.serviceID" :label="item.serviceName" :value="item.serviceID" />
              </el-select>
            </el-form-item>
            <!-- <el-form-item label="供应商" prop="name">
              <el-input v-model="listQuery.name" placeholder="请输入供应商"></el-input>
            </el-form-item> -->
            <el-form-item>
                <button class="btn btn-default" type="button" @click="handleQuery">查询</button>
                <button class="btn btn-lg bg-green" v-loading.fullscreen.lock="downloading" @click="downloadCustomer" type="button"><i class="entypo-pencil"></i>导出</button>
            </el-form-item>
          </el-form>

          <div class="box-body">
            <div class="table-responsive">
              <el-table
                :key="tableKey"
                v-loading="listLoading"
                :data="list"
                border
                fit
                stripe
                highlight-current-row
                style="width: 100%;"
                @cell-click="handleCustomer"
                @selection-change="selectionChange"
              >
                <el-table-column
                  label="客户号"
                  prop="customerID"
                  align="left"
                  min-width="80" />
                <el-table-column
                  label="客户姓名"
                  prop="custName"
                  align="left"
                  min-width="80" />
                <el-table-column
                  label="性别"
                  align="left"
                  width="60">
                  <template slot-scope="scope">
                    <span v-if="scope.row.gender == 0">男</span>
                    <span v-if="scope.row.gender == 1">女</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="证件号"
                  prop="certID"
                  min-width="150"/>
                <el-table-column
                  label="手机号"
                  prop="phoneNumber"
                  :formatter="filterPhoneNumber"
                  min-width="110"/>
                <!-- <el-table-column
                  label="客户状态"
                  prop=""
                  align="left"
                  width="80">
                  <template slot-scope="scope">
                    <span v-if="scope.row.custStatus == 0">已使用</span>
                    <span v-if="scope.row.custStatus == 2">未使用</span>
                  </template>
                </el-table-column> -->
                <el-table-column
                  label="可用积分/已用积分"
                  prop="remnPoint"
                  align="left"
                  width="140">
                  <template slot-scope="scope">
                    <span>{{scope.row.remnPoint}} / {{scope.row.usedPoint}}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="首单生效时间"
                  prop="firstEffTime"
                  align="left"
                  width="120">
                  <template slot-scope="scope">
                    <span>{{formatDate(scope.row.firstEffTime)}}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  label="最近使用时间"
                  prop="lastUseTime"
                  align="left"
                  width="120" >
                  <template slot-scope="scope">
                    <span>{{formatDate(scope.row.lastUseTime)}}</span>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div class="box-footer clearfix">
            <!-- 控制分页模块 -->
            <pagination align="right" v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
          </div>
        </div>
      </div>
    </div>
    <!-- 查看 -->
    <el-dialog
      :visible.sync="sysRoleVisible"
      :append-to-body="true"
      :close-on-click-modal="false"
      :before-close="handleCloseBindWarn"
      style="margin-top: -5vh;"
      >
      <el-dialog
        width="600px"
        title="内层 Dialog"
        :close-on-click-modal="false"
        :visible.sync="innerVisible"
        append-to-body>
        <div class="modal-header bg-white">
          <h4 id="myLargeModalLabel" class="modal-title">
            <span class="profile-rounded"><i class="fontello-wrench-outline"></i>
            </span>&nbsp;&nbsp; 使用详情
          </h4>
        </div>
        <div class="box-body">
          <el-table
            :key="tableKey"
            :data="consumeHistories"
            style="width: 100%">
            <el-table-column
              label="使用时间"
              prop=""
              align="left"
              min-width="40">
              <template slot-scope="scope">
                <span>{{formatDate(scope.row.consumeTime)}}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="描述"
              prop="remarks"
              align="left"
              min-width="50"/>
          </el-table>
        </div>
        <div class="attribute-operation clearfix fr">
          <el-button
            type="primary"
            @click="closeInnerVisible()">
            关闭
          </el-button>
        </div>
      </el-dialog>
      <div class="row">
        <div class="col-xs-12 invoice-header" style="padding: 0 35px;">
          <h2 class="page-header">
            <i class="fa fa-globe"></i> 客户: {{personalDetail.custName}}
            <small class="pull-right">最近使用时间: {{personalDetail.lastUseTime}}</small>
          </h2>
        </div>
      </div>
      <div class="row invoice-info" style="padding: 0 35px;">
        <div class="col-sm-4 invoice-col">
            基本信息
            <address>
                <strong>{{personalDetail.custName}}</strong>
                <br>性别：{{personalDetail.gender == 0 ? '男' : '女'}}
               <br>身份证号：{{personalDetail.certID}}
                <br>手机号: {{filterPhoneNumber(personalDetail)}}
                <br/>
            </address>
        </div>
        <div class="col-sm-4 invoice-col">
            <address>
                <br/>
                <strong></strong>
                <br>
                <!-- {{personalDetail.custStatus == 0 ? '已使用' : '未使用'}} -->
                <br>客户状态：
                <br>首单生效时间：{{formatDate(personalDetail.firstEffTime)}}
            </address>
        </div>
        <div class="col-sm-4 invoice-col">
            <address>
                <br/>

                <strong></strong>
                <br>服务规划师：{{selectedCustomer.agentName}}
                <br>联系方式：{{filterPhoneNumber({phoneNumber: selectedCustomer.agentPhoneNumber})}}
                <br/>所属机构：{{selectedCustomer.agentInfo ? selectedCustomer.agentInfo.agencyName : ''}}
            </address>
        </div>
      </div>
      <!-- 积分-->
      <div class="box">
        <div class="box-header">
          <h3 class="box-title">当前剩余积分：{{personalDetail.remnPoint || 0}}</h3>
        </div>
        <div class="box-body">
          <el-table
            :key="tableKey"
            :data="pointList"
            :show-header="false"
            style="width: 100%">
            <el-table-column
              prop="createTime"
              align="left"
              min-width="40">
              <template slot-scope="scope">{{formatTime(scope.row.createTime)}}</template>
            </el-table-column>
            <el-table-column
              prop="txnContent"
              align="left"
              min-width="50" />
            <el-table-column
              prop="txnPoint"
              align="left"
              min-width="50" />
          </el-table>
        </div>
      </div>
      <!-- /积分-->
      <!-- 客户权益-->
      <div class="box">
        <div class="box-header">
          <h3 class="box-title">客户权益</h3>
        </div>
        <div class="box-body">
          <el-table
            :key="tableKey"
            :data="customerEquities"
            style="width: 100%"
            max-height="450"
            @expand-change="handleexpandChange">
            <el-table-column type="expand">
              <template slot-scope="props">
                <el-table
                  :key="tableKey"
                  :data="props.row.services"
                  @row-click="handleRights"
                  height="360"
                  stripe
                  style="width: 100%;"
                >
                  <el-table-column
                    label="权益名称"
                    align="left"
                    min-width="50">
                    <template>{{props.row.equityName}}</template>
                  </el-table-column>
                  <el-table-column
                    label="权益级别"
                    align="left"
                    min-width="50">
                    <template>{{props.row.custLevelName}}</template>
                  </el-table-column>
                  <el-table-column
                    label="服务名称"
                    prop="serviceName"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="可用次数"
                    prop="totalNumber"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="已用次数"
                    prop="usedCount"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="使用时间"
                    align="left"
                    width="120">
                    <template slot-scope="scope">{{formatDate(scope.row.lastUseTime)}}</template>
                  </el-table-column>
                  <el-table-column
                    label="项目内容简介"
                    prop="serviceIntr"
                    align="left"
                    width="200" />
                  <el-table-column
                    label="使用流程"
                    prop="serviceProcess"
                    align="left"
                    width="240" />
                  <el-table-column
                    label="供应商"
                    prop="supplierName"
                    align="left"
                    min-width="60" />
                </el-table>
              </template>
            </el-table-column>
            <el-table-column
              label="权益名称"
              prop="equityName"
              align="left" />
            <el-table-column
              label="权益等级"
              prop="custLevelName"
              align="left" />
            <el-table-column
              label="时间"
              prop="usedTIme"
              align="left">
              <template slot-scope="scope">{{formatTime(scope.row.usedTIme)}}</template>
            </el-table-column>
          </el-table>

        </div>
      </div>
      <!-- /客户权益-->
      <!-- 保单权益-->
      <div class="box">
        <div class="box-header">
          <h3 class="box-title">保单权益</h3>
        </div>
        <div class="box-body">
          <el-table
            :key="tableKey"
            :data="policyEquities"
            style="width: 100%"
            max-height="450"
            @expand-change="handleexpandChange2">
            <el-table-column type="expand">
              <template slot-scope="props">
                <el-table
                  :key="tableKey"
                  :data="props.row.services"
                  @row-click="handleRights"
                  height="360"
                  stripe
                  style="width: 100%;"
                >
                  <el-table-column
                    label="权益名称"
                    align="left"
                    min-width="50">
                    <template>{{props.row.equityName}}</template>
                  </el-table-column>
                  <el-table-column
                    label="权益级别"
                    align="left"
                    min-width="50">
                    <template>{{props.row.custLevelName}}</template>
                  </el-table-column>
                  <el-table-column
                    label="服务名称"
                    prop="serviceName"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="可用次数"
                    prop="totalNumber"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="已用次数"
                    prop="usedCount"
                    align="left"
                    min-width="50" />
                  <el-table-column
                    label="使用时间"
                    align="left"
                    width="120">
                    <template slot-scope="scope">{{formatDate(scope.row.lastUseTime)}}</template>
                  </el-table-column>
                  <el-table-column
                    label="项目内容简介"
                    prop="serviceIntr"
                    align="left"
                    width="200" />
                  <el-table-column
                    label="使用流程"
                    prop="serviceProcess"
                    align="left"
                    width="240" />
                  <el-table-column
                    label="供应商"
                    prop="supplierName"
                    align="left"
                    min-width="60" />
                </el-table>
              </template>
            </el-table-column>
            <el-table-column
              label="保单号"
              prop="policy.policyNumber"
              align="left"
              min-width="121" />
            <el-table-column
              label="签单机构"
              prop="policy.agencyName"
              align="left"
              min-width="100" />
            <el-table-column
              label="渠道名称"
              prop="policy.channelName"
              align="left"
              min-width="100" />
            <el-table-column
              label="所属区部"
              prop="policy.districtName"
              align="left"
              min-width="100" />
            <el-table-column
              label="营业网点名称"
              prop="policy.branchName"
              align="left"
              min-width="100" />
            <el-table-column
              label="二级机构名称"
              prop="policy.secondAgencyName"
              align="left"
              min-width="100" />
            <el-table-column
              label="被保险人姓名"
              prop="customer.custName"
              align="left"
              min-width="100">
              <template>{{selectedCustomer.custName}}</template>
            </el-table-column>
            <el-table-column
              label="被保人证件号"
              prop="policy.insuredCard"
              min-width="120"/>
            <el-table-column
              label="被保险人电话"
              prop="policy.insuredPhone"
              :formatter="filterPhoneNumber"
              min-width="100" >
            </el-table-column>
            <el-table-column
              label="保单生效日期"
              prop="insEffeData"
              align="left"
              min-width="120">
              <template slot-scope="scope">
                {{formatDate(scope.row.policy.insEffeData)}}
              </template>
            </el-table-column>
            <el-table-column
              label="服务生效时间"
              prop="serviceEffeData"
              align="left"
              min-width="120">
              <template slot-scope="scope">
                {{formatDate(scope.row.policy.serviceEffeData)}}
              </template>
            </el-table-column>
            <el-table-column
              label="规划师"
              align="left"
              width="120">
              <template>
                <span>{{selectedCustomer.agentName}}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="保单状态"
              prop="policyStatus"
              align="left"
              width="120">
              <template slot-scope="scope">
                <span>{{policyStatus(scope.row.policy.policyStatus)}}</span>
              </template>
            </el-table-column>
          </el-table>

        </div>
      </div>
      <!-- /保单权益-->
      <div class="attribute-operation clearfix fr">
        <el-button
          type="primary"
          @click="handleCloseBindWarn()">
          关闭
        </el-button>
      </div>

    </el-dialog>
    <!-- /查看 -->
  </div>
</template>

<script>
import { getPageCustomer, getPoint, getEquity, downloadBlob, getCustomer, downloadCustomer, getPointHistory } from '../../../api/customerManagement'
import { getEquityLevel } from '@/api/rightsManagement'
import { getService } from '@/api/supplierManagement/project'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import moment from 'moment';
import {getServicesConsumeHistory} from "../../../api/supplierManagement/supplierUser";

export default {
  name: 'sysRole',
  components: { Pagination },
  data() {
    return {
      tableKey: 0,
      userCompany: '',
      list_cs: [{
        "customerID": null, "custName": "测试", "gender": 0,
        "certID": "123123", "phoneNumber": null, "custStatus": 1, "usedPoint": 0, "remnPoint": 0, "agentCode": "123123", "agentName":"123123" , "agentAgency": "123123",
        "agentPhoneNumber": "123123", "firstEffTime": null, "lastUseTime": null
      }],
      list: null,
      total: 0,
      listLoading: false,
      listQuery: {
        custName: null, // 客户姓名
        certID: null, // 证件号
        equityType: null, // 权益类型
        equityLevelID: null, // 权益等级ID
        // serviceName: null, // 服务名称
        serviceID: null,
        pageNum: 1,
        pageSize: 20
      },
      equityOptions: [], // 权益级别
      equityLevelOptions: [],
      equityLevelArr: [],
      serviceNameList: null, // 服务名称
      sysRoleVisible: false,
      innerVisible: false,
      gradeOptions: [
        {
          label: '保单权益',
          value: '1'
        },
        {
          label: '客户权益',
          value: '2'
        }
      ],
      personalDetail: {},
      pointList: [],
      equityList: [],
      policyList: [],
      selectionData: null,
      listEquityList: [],
      listpolicyList: [],
      selectedCustomer: {},
      equityArray: [],
      customerEquities: [],
      policyEquities: [],
      downloading: false,
      consumeHistories: [],
      hidePrivate: false
    }
  },
  created() {
    this.hidePrivate = localStorage.getItem('hidePrivate') === '1';
    let user = JSON.parse(localStorage.getItem('user'));
    this.userCompany = user.dept.deptName;
    getService().then(res => {
      this.serviceNameList = res
    })
    this.getEquityLevel()
    this.getList()
  },
  methods: {
    filterPhoneNumber(dat) {
      let phoneNumber = dat.phoneNumber || dat.policy?.insuredPhone;
      if (!phoneNumber) {
        return '';
      }
      if (!this.hidePrivate) {
        return phoneNumber;
      } else {
        return phoneNumber.substr(0, 3) + '****' + phoneNumber.substr(7);
      }
    },
    policyStatus(code) {
      // 0-未承保 1-已承保  4-已终止  2-新增附加险  9-续保未生效
      if (code === '0') {
        return '未承保';
      } else if (code === '1') {
        return '已承保';
      } else if (code === '2') {
        return '新增附加险';
      } else if (code === '4') {
        return '已终止';
      } else if (code === '9') {
        return '续保未生效';
      }
      return '';
    },
    formatDate(timeStr) {
      if (!timeStr) {
        return '';
      }
      return moment(timeStr).format('YYYY-MM-DD');
    },
    formatTime(timeStr) {
      if (!timeStr) {
        return '';
      }
      return moment(timeStr).format('YYYY-MM-DD hh:mm:ss');
    },
    getList() {
      this.listLoading = true

      getPageCustomer(this.listQuery).then(response => {
        this.list = response.list
        this.total = response.total
        this.listLoading = false
      })
      .catch(() => {
        this.listLoading = false
      })
    },
    // 查询
    handleQuery() {
      this.pageNum = 1
      this.getList()
    },
    // 展开详情
    async handleCustomer(row) {
      this.sysRoleVisible = true
      this.personalDetail = row

      let customer = await getCustomer(row.customerID);
      // 计算服务使用次数
      customer.customerEquities.forEach(eq => {
        if (eq.consumeHistories && eq.services) {
          eq.services.forEach(service => {
            let history = eq.consumeHistories.find(h => h.serviceID === service.serviceID);
            if (history) {
              service.usedCount = history.numConsumed;
            }
          })
        }
      })
      this.selectedCustomer = customer;
      this.customerEquities = this.selectedCustomer.customerEquities.filter(e => !e.policyNumber);
      this.policyEquities = this.selectedCustomer.customerEquities.filter(e => !!e.policyNumber);

      getPointHistory(row.customerID).then(resp => {
        console.log('got point his:', resp);
        this.pointList = resp;
      })

      // getPoint({customerID: row.customerID}).then(response => {
      //   this.pointList = response.list
      // })
      let params = {
        customerID: row.customerID,
        agentCode: row.agentCode || '',
        customerType: row.customerType
      }
      getEquity(params).then(response => {
        this.equityList = response.list
      })
      // getPolicyByCustomerID(row.customerID).then(response => {
      //   this.policyList = response.list
      // })
    },
    changeEquityType(val) {
      // console.log(val, this.equityArray);
      if (val) {
        this.listQuery.equityType = val;
        this.listQuery.equityID = null;
        this.listQuery.equityLevelID = null;
        this.equityOptions = this.equityArray.filter(e => {
          // console.log(e.equityType, val);
          return e.equityType === parseInt(val);
        });
        this.equityLevelOptions = [];
      }else{
        this.listQuery.equityType = null;
        this.equityOptions = this.equityArray;
        // this.listQuery.equityID = null;
        // this.listQuery.equityLevelID = null;
      }
    },
    changeEquity(val) {
      this.listQuery.equityLevelID = null;
      if (val) {
        this.equityLevelOptions = this.equityOptions.find(e => e.equityID === val).equityLevel;
      } else {
        this.equityLevelOptions = [];
      }
    },
    changeEquityLevel(val) {
      let query = {

      }
      this.serviceNameList = this.equityLevelArr.find(e => e.equityLevelID === val).serviceLevelDef;
    },
    // 选择客户
    selectionChange(row) {
      this.selectionData = row
    },
    // 权益级别
    getEquityLevel() {
      let params = {
        equityName: this.listQuery.equityName,
        equityType: this.listQuery.equityType
      }
      getEquityLevel(params).then(resp => {
        let equity = {};
        resp.forEach(e => {
          if (!equity[e.equityID]) {
            equity[e.equityID] = {
              equityName: e.equityName,
              equityID: e.equityID,
              equityType: e.equityType,
              equityLevel: []
            };
          }
          equity[e.equityID].equityLevel.push({equityLevelID: e.equityLevelID, equityLevelName: e.equityLevelName});
        })
        // console.log('object', Object.values(equity));
        this.equityArray = Object.values(equity);
        this.equityLevelArr = resp
        this.equityOptions = Object.values(equity);
      })
    },
    // 展开权益详情
    handleRights(row) {
      getServicesConsumeHistory({customerID: this.selectedCustomer.customerID, serviceID: row.serviceID}).then(resp => {
        this.consumeHistories = resp;
        this.innerVisible = true;
      });
    },
    handleexpandChange(row) {
      // console.log(row)
      // getPolicyServices(row.policyNumber).then(resp => {
      //   console.log('result::::', resp);
      //   this.listEquityList = resp.data;
      // })
      // getServices({customerID: row.customerID}).then(response => {
      //   this.listEquityList = response.data
      // })
    },
    handleexpandChange2(row) {
      // console.log('change 2', row);
      // getPolicyServices(row.policyNumber).then(resp => {
      //   console.log('result::::', resp);
      //   this.listpolicyList = resp.data
      // })
    },
    // 关闭
    handleCloseBindWarn() {
      this.sysRoleVisible = false
    },
    closeInnerVisible() {
      this.innerVisible = false
    },
    // 导出
    downloadCustomer() {
      // this.downloading = true;
      let user = JSON.parse(localStorage.getItem('user'));
      let url = process.env.VUE_APP_BASE_API + '/excel/downloadCustomer?deptID=' + user.deptId;
      url += `&hidePrivate=${this.hidePrivate}`;
      if (this.listQuery.equityType) {
        url += `&equityType=${this.listQuery.equityType}`;
      }
      if (this.listQuery.equityID) {
        url += `&equityID=${this.listQuery.equityID}`;
      }
      if (this.listQuery.equityLevelID) {
        url += `&equityLevelID=${this.listQuery.equityLevelID}`;
      }
      if (this.listQuery.serviceID) {
        url += `&serviceID=${this.listQuery.serviceID}`;
      }
// console.log('url:::', url);
      // let objectUrl = URL.createObjectURL(url)
      const link = document.createElement('a')
      // link.download = fileName
      link.href = url
      link.target = '_blank';
      link.click()


      // downloadBlob(this.listQuery).then(res => {
      //   console.log('res:::', res);
      //   // const stream = res.data; // 后端用stream返回Excel文件
      //   // const blob = new Blob([stream]);
      //   // if (res.status !== 200) {
      //     // 非正常业务码，执行错误处理
      //     // 注意：status字段名是团队自行定义的
      //   // }
      //
      //   // 前端获取业务码，成功执行正常业务
      //   const downloadElement = document.createElement('a');
      //   const href = window.URL.createObjectURL(res); // 创建下载的链接
      //   downloadElement.href = href;
      //   const timeStamp = new Date().toString();
      //   const nameStr = moment().format('YYYYMMDDHHmmss') + '.xlsx';
      //   downloadElement.download = nameStr; // 下载后文件名
      //   document.body.appendChild(downloadElement);
      //   downloadElement.click(); // 点击下载
      //   document.body.removeChild(downloadElement); // 下载完成移除元素
      //   window.URL.revokeObjectURL(href); // 释放掉blob对象
      //   this.downloading = false;
      // })

      // let url = ''+process.env.VUE_APP_BASE_API+'/excel/downloadCustomer'
      // if (this.listQuery.custName) {
      //   url+='?custName='+this.listQuery.custName
      // }else if(this.listQuery.certID){
      //   url+='?certID='+this.listQuery.certID
      // }else if(this.listQuery.equityID){
      //   url+='?equityID='+this.listQuery.equityID
      // }else if(this.listQuery.equityLevelID){
      //   url+='?equityLevelID='+this.listQuery.equityLevelID
      // }else if(this.listQuery.serviceName){
      //   url+='?serviceName='+this.listQuery.serviceName
      // }
      // console.log(url)
      // let fileName = res.headers['content-disposition'].split('=')[1]
      // let objectUrl = URL.createObjectURL(url)
      // const link = document.createElement('a')
      // // link.download = fileName
      // link.href = url
      // link.click()
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep{
  .el-table thead{
    color: #888888;
    font-size: 13px;
  }
  .el-table tr{
    color: #888888;
    font-size: 13px;
  }
  .el-table--medium th{
    padding: 8px 0;
  }
  .el-table--medium td{
    padding: 8px 0;
  }
  .btn1{
    color: #37A8AF;
    font-size: 13px;
  }
  .el-table--striped .el-table__body tr.el-table__row--striped td{
    background: #f3f4f5;
  }
  .el-pagination{
    padding: 0;
    margin-right: -4px;
  }
  .pagination-container{
    padding: 0;
    margin: 0;
  }
  .el-dialog__header{
    display: none;
  }
  .el-dialog__body{
    padding: 25px 30px 60px;
    font-size: 13px;
    color: #888888;
  }
  .modal-body{
    padding: 20px;
  }
  .el-dialog{
    width: 95%;
    margin-top: 10vh !important;
  }
  .el-form-item{
    margin-bottom: 15px;
  }
  .el-input__inner{
    color: #555555;
    border: 1px solid #cccccc;
  }
}
.demo-form-inline{
  padding: 40px 0 0 35px;
}
.box{
  margin-bottom: 0;
}
.box-body{
  padding-top: 0;
}
.btn-default{
  margin-right: 10px;
}
</style>
